﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FeeMgrCom;
using Common;
using FeeMgrCom.BLL;

namespace pms.FeeMgr
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        protected void SetFieldEnable()
        {

            //滞纳金双比例
            txtLateFeeDerateInRate.Enabled = true;
            txtLateFeeDerateOutRate.Enabled = true;
            //滞纳金单比例
            txtLateFeeSingleRate.Enabled = true;
        }

        protected void Page_Load(object sender, EventArgs e)
        {

            if (!Page.IsPostBack)
            {
                //if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
                //{
                //    string id = Request.Params["id"];
                    ShowInfo(1);
                //}
            }

        }

        private void ShowInfo(int GLCParaSetID)
        {
            FeeMgrCom.BLL.FeeOfGLCParaSet bll = new FeeMgrCom.BLL.FeeOfGLCParaSet();
            FeeMgrCom.Model.FeeOfGLCParaSet model = bll.GetModel(GLCParaSetID);
            this.DDLBGetFeeDate_Type.SetValue(model.GetFeeDate_Type);
            this.txtGetFeeDate_NMonths.Text = model.GetFeeDate_NMonths.ToString();
            this.txtGetFeeDate_Day.Text = model.GetFeeDate_Day.ToString();
            this.DDLBCopyMeterDate_Type.SetValue( model.CopyMeterDate_Type);
            this.txtCopyMeterDate_NMonths.Text = model.CopyMeterDate_NMonths.ToString();
            this.txtCopyMeterDate_Day.Text = model.CopyMeterDate_Day.ToString();
            this.DDLBCarryForward_Type.SetValue(model.CarryForward_Type);
            this.txtCarryForward_NMonths.Text = model.CarryForward_NMonths.ToString();
            this.txtCarryForward_Day.Text = model.CarryForward_Day.ToString();
            this.DDLBLateFeeDaysSet_Type.SetValue( model.LateFeeDaysSet_Type);
            this.txtLateFeeDaysSet_Date.Text = ((DateTime)(model.LateFeeDaysSet_Date)).ToString("yyyy-MM-dd");
            this.DDLBLateFeeDerate_Type.SetValue( model.LateFeeDerate_Type);
            this.txtLateFeeDerate_NMonths.Text = model.LateFeeDerate_NMonths.ToString();
            this.txtLateFeeDerate_Day.Text = model.LateFeeDerate_Day.ToString();
            this.CHBLateFeeDerate_IsGetOver.Checked= (model.LateFeeDerate_IsGetOver=="Y");
            this.txtLateFeeSingleRate.Text = model.LateFeeSingleRate.ToString().Substring(0,6);
            this.CBXLateFeeIsUseInOutRate.Checked = !(model.LateFeeIsUseInOutRate=="Y");
            this.txtLateFeeDerateInRate.Text = (model.LateFeeDerateInRate.ToString()).Substring(0,6);
            this.txtLateFeeDerateOutRate.Text = (model.LateFeeDerateOutRate.ToString()).Substring(0,6);
            this.txtNotifyBillMemo.Text = model.NotifyBillMemo;
            this.txtUrgeBillMemo.Text = model.UrgeBillMemo;
            this.txtBillNOType_FeeGet.Text = model.BillNOType_FeeGet;
            this.txtBillNOFeeGet_Pre.Text = model.BillNOFeeGet_Pre;
            this.txtBillNOFeeGet_Mid.Text = model.BillNOFeeGet_Mid;
            this.txtBillNOFeeGet_IDLen.Text = model.BillNOFeeGet_IDLen.ToString();
            this.txtBillNOType_FeeDerate.Text = model.BillNOType_FeeDerate;
            this.txtBillNOFeeDerate_Pre.Text = model.BillNOFeeDerate_Pre;
            this.txtBillNOFeeDerate_Mid.Text = model.BillNOFeeDerate_Mid;
            this.txtBillNOFeeDerate_IDLen.Text = model.BillNOFeeDerate_IDLen.ToString();
            this.txtBillNOType_PreGet.Text = model.BillNOType_PreGet;
            this.txtBillNOPreGet_Pre.Text = model.BillNOPreGet_Pre;
            this.txtBillNOPreGet_Mid.Text = model.BillNOPreGet_Mid;
            this.txtBillNOPreGet_IDLen.Text = model.BillNOPreGet_IDLen.ToString();
            this.txtBillNOType_PreBack.Text = model.BillNOType_PreBack;
            this.txtBillNOPreBack_Pre.Text = model.BillNOPreBack_Pre;
            this.txtBillNOPreBack_Mid.Text = model.BillNOPreBack_Mid;
            this.txtBillNOPreBack_IDLen.Text = model.BillNOPreBack_IDLen.ToString();
            this.txtBillNOType_PreTakeOut.Text = model.BillNOType_PreTakeOut;
            this.txtBillNOPreTakeOut_Pre.Text = model.BillNOPreTakeOut_Pre;
            this.txtBillNOPreTakeOut_Mid.Text = model.BillNOPreTakeOut_Mid;
            this.txtBillNOPreTakeOut_IDLen.Text = model.BillNOPreTakeOut_IDLen.ToString();
            this.txtBillNOType_DepositGet.Text = model.BillNOType_DepositGet;
            this.txtBillNODepositGet_Pre.Text = model.BillNODepositGet_Pre;
            this.txtBillNODepositGet_Mid.Text = model.BillNODepositGet_Mid;
            this.txtBillNODepositGet_IDLen.Text = model.BillNODepositGet_IDLen.ToString();
            this.txtBillNOType_DepositBack.Text = model.BillNOType_DepositBack;
            this.txtBillNODepositBack_Pre.Text = model.BillNODepositBack_Pre;
            this.txtBillNODepositBack_Mid.Text = model.BillNODepositBack_Mid;
            this.txtBillNODepositBack_IDLen.Text = model.BillNODepositBack_IDLen.ToString();
            this.txtBillNOType_DepositDeduct.Text = model.BillNOType_DepositDeduct;
            this.txtBillNODepositDeduct_Pre.Text = model.BillNODepositDeduct_Pre;
            this.txtBillNODepositDeduct_Mid.Text = model.BillNODepositDeduct_Mid;
            this.txtBillNODepositDeduct_IDLen.Text = model.BillNODepositDeduct_IDLen.ToString();
            this.txtBillNOType_BankGet.Text = model.BillNOType_BankGet;
            this.txtBillNOBankGet_Pre.Text = model.BillNOBankGet_Pre;
            this.txtBillNOBankGet_Mid.Text = model.BillNOBankGet_Mid;
            this.txtBillNOBankGet_IDLen.Text = model.BillNOBankGet_IDLen.ToString();
            this.DDLBBillPrint_Option.SetValue(model.BillPrint_Option);
            this.DDLBCarryYear.SetValue( model.CarryYear);
            this.DDLBCarryMonth.SetValue( model.CarryMonth);
            //this.txtAppGLCNO.Text = model.AppGLCNO;
            //this.txtAppCorpNO.Text = model.AppCorpNO;
            //this.txtAppUpdateState.Text = model.AppUpdateState;
            //this.txtAppOrder.Text = model.AppOrder.ToString();
            DDLBGetFeeDate_Type_Related();
            DDLBCopyMeterDate_Type_Related();
            DDLBCarryForward_Type_Related();
            DDLBLateFeeDaysSet_Type_Related();
            DDLBLateFeeDerate_Type_Related();
            CBXLateFeeIsUseInOutRate_Related();
        }


        public void btnUpdate_Click(object sender, EventArgs e)
        {

            //string strErr = "";
            //if (this.txtGetFeeDate_Type.Text == "")
            //{
            //    strErr += "GetFeeDate_Type不能为空！\\n";
            //}
            //if (!PageValidate.IsNumber(txtGetFeeDate_NMonths.Text))
            //{
            //    strErr += "GetFeeDate_NMonths不是数字！\\n";
            //}
            //if (!PageValidate.IsNumber(txtGetFeeDate_Day.Text))
            //{
            //    strErr += "GetFeeDate_Day不是数字！\\n";
            //}
            //if (this.txtCopyMeterDate_Type.Text == "")
            //{
            //    strErr += "CopyMeterDate_Type不能为空！\\n";
            //}
            //if (!PageValidate.IsNumber(txtCopyMeterDate_NMonths.Text))
            //{
            //    strErr += "CopyMeterDate_NMonths不是数字！\\n";
            //}
            //if (!PageValidate.IsNumber(txtCopyMeterDate_Day.Text))
            //{
            //    strErr += "CopyMeterDate_Day不是数字！\\n";
            //}
            ////if (this.txtCarryForward_Type.Text == "")
            ////{
            ////    strErr += "CarryForward_Type不能为空！\\n";
            ////}
            //if (!PageValidate.IsNumber(txtCarryForward_NMonths.Text))
            //{
            //    strErr += "CarryForward_NMonths不是数字！\\n";
            //}
            //if (!PageValidate.IsNumber(txtCarryForward_Day.Text))
            //{
            //    strErr += "CarryForward_Day不是数字！\\n";
            //}
            //if (this.txtLateFeeDaysSet_Type.Text == "")
            //{
            //    strErr += "LateFeeDaysSet_Type不能为空！\\n";
            //}
            //if (!PageValidate.IsDateTime(txtLateFeeDaysSet_Date.Value))
            //{
            //    strErr += "LateFeeDaysSet_Date不是时间格式！\\n";
            //}
            //if (this.txtLateFeeDerate_Type.Text == "")
            //{
            //    strErr += "LateFeeDerate_Type不能为空！\\n";
            //}
            //if (!PageValidate.IsNumber(txtLateFeeDerate_NMonths.Text))
            //{
            //    strErr += "LateFeeDerate_NMonths不是数字！\\n";
            //}
            //if (!PageValidate.IsNumber(txtLateFeeDerate_Day.Text))
            //{
            //    strErr += "LateFeeDerate_Day不是数字！\\n";
            //}
            //if (this.txtLateFeeDerate_IsGetOver.Text == "")
            //{
            //    strErr += "LateFeeDerate_IsGetOver不能为空！\\n";
            //}
            //if (!PageValidate.IsDecimal(txtLateFeeSingleRate.Text))
            //{
            //    strErr += "LateFeeSingleRate不是数字！\\n";
            //}
            //if (this.txtLateFeeIsUseInOutRate.Text == "")
            //{
            //    strErr += "LateFeeIsUseInOutRate不能为空！\\n";
            //}
            //if (!PageValidate.IsDecimal(txtLateFeeDerateInRate.Text))
            //{
            //    strErr += "LateFeeDerateInRate不是数字！\\n";
            //}
            //if (!PageValidate.IsDecimal(txtLateFeeDerateOutRate.Text))
            //{
            //    strErr += "LateFeeDerateOutRate不是数字！\\n";
            //}
            //if (this.txtNotifyBillMemo.Text == "")
            //{
            //    strErr += "NotifyBillMemo不能为空！\\n";
            //}
            //if (this.txtUrgeBillMemo.Text == "")
            //{
            //    strErr += "UrgeBillMemo不能为空！\\n";
            //}
            //if (this.txtBillNOType_FeeGet.Text == "")
            //{
            //    strErr += "BillNOType_FeeGet不能为空！\\n";
            //}
            //if (this.txtBillNOFeeGet_Pre.Text == "")
            //{
            //    strErr += "BillNOFeeGet_Pre不能为空！\\n";
            //}
            //if (this.txtBillNOFeeGet_Mid.Text == "")
            //{
            //    strErr += "BillNOFeeGet_Mid不能为空！\\n";
            //}
            //if (!PageValidate.IsNumber(txtBillNOFeeGet_IDLen.Text))
            //{
            //    strErr += "BillNOFeeGet_IDLen不是数字！\\n";
            //}
            //if (this.txtBillNOType_FeeDerate.Text == "")
            //{
            //    strErr += "BillNOType_FeeDerate不能为空！\\n";
            //}
            //if (this.txtBillNOFeeDerate_Pre.Text == "")
            //{
            //    strErr += "BillNOFeeDerate_Pre不能为空！\\n";
            //}
            //if (this.txtBillNOFeeDerate_Mid.Text == "")
            //{
            //    strErr += "BillNOFeeDerate_Mid不能为空！\\n";
            //}
            //if (!PageValidate.IsNumber(txtBillNOFeeDerate_IDLen.Text))
            //{
            //    strErr += "BillNOFeeDerate_IDLen不是数字！\\n";
            //}
            //if (this.txtBillNOType_PreGet.Text == "")
            //{
            //    strErr += "BillNOType_PreGet不能为空！\\n";
            //}
            //if (this.txtBillNOPreGet_Pre.Text == "")
            //{
            //    strErr += "BillNOPreGet_Pre不能为空！\\n";
            //}
            //if (this.txtBillNOPreGet_Mid.Text == "")
            //{
            //    strErr += "BillNOPreGet_Mid不能为空！\\n";
            //}
            //if (!PageValidate.IsNumber(txtBillNOPreGet_IDLen.Text))
            //{
            //    strErr += "BillNOPreGet_IDLen不是数字！\\n";
            //}
            //if (this.txtBillNOType_PreBack.Text == "")
            //{
            //    strErr += "BillNOType_PreBack不能为空！\\n";
            //}
            //if (this.txtBillNOPreBack_Pre.Text == "")
            //{
            //    strErr += "BillNOPreBack_Pre不能为空！\\n";
            //}
            //if (this.txtBillNOPreBack_Mid.Text == "")
            //{
            //    strErr += "BillNOPreBack_Mid不能为空！\\n";
            //}
            //if (!PageValidate.IsNumber(txtBillNOPreBack_IDLen.Text))
            //{
            //    strErr += "BillNOPreBack_IDLen不是数字！\\n";
            //}
            //if (this.txtBillNOType_PreTakeOut.Text == "")
            //{
            //    strErr += "BillNOType_PreTakeOut不能为空！\\n";
            //}
            //if (this.txtBillNOPreTakeOut_Pre.Text == "")
            //{
            //    strErr += "BillNOPreTakeOut_Pre不能为空！\\n";
            //}
            //if (this.txtBillNOPreTakeOut_Mid.Text == "")
            //{
            //    strErr += "BillNOPreTakeOut_Mid不能为空！\\n";
            //}
            //if (!PageValidate.IsNumber(txtBillNOPreTakeOut_IDLen.Text))
            //{
            //    strErr += "BillNOPreTakeOut_IDLen不是数字！\\n";
            //}
            //if (this.txtBillNOType_DepositGet.Text == "")
            //{
            //    strErr += "BillNOType_DepositGet不能为空！\\n";
            //}
            //if (this.txtBillNODepositGet_Pre.Text == "")
            //{
            //    strErr += "BillNODepositGet_Pre不能为空！\\n";
            //}
            //if (this.txtBillNODepositGet_Mid.Text == "")
            //{
            //    strErr += "BillNODepositGet_Mid不能为空！\\n";
            //}
            //if (!PageValidate.IsNumber(txtBillNODepositGet_IDLen.Text))
            //{
            //    strErr += "BillNODepositGet_IDLen不是数字！\\n";
            //}
            //if (this.txtBillNOType_DepositBack.Text == "")
            //{
            //    strErr += "BillNOType_DepositBack不能为空！\\n";
            //}
            //if (this.txtBillNODepositBack_Pre.Text == "")
            //{
            //    strErr += "BillNODepositBack_Pre不能为空！\\n";
            //}
            //if (this.txtBillNODepositBack_Mid.Text == "")
            //{
            //    strErr += "BillNODepositBack_Mid不能为空！\\n";
            //}
            //if (!PageValidate.IsNumber(txtBillNODepositBack_IDLen.Text))
            //{
            //    strErr += "BillNODepositBack_IDLen不是数字！\\n";
            //}
            //if (this.txtBillNOType_DepositDeduct.Text == "")
            //{
            //    strErr += "BillNOType_DepositDeduct不能为空！\\n";
            //}
            //if (this.txtBillNODepositDeduct_Pre.Text == "")
            //{
            //    strErr += "BillNODepositDeduct_Pre不能为空！\\n";
            //}
            //if (this.txtBillNODepositDeduct_Mid.Text == "")
            //{
            //    strErr += "BillNODepositDeduct_Mid不能为空！\\n";
            //}
            //if (!PageValidate.IsNumber(txtBillNODepositDeduct_IDLen.Text))
            //{
            //    strErr += "BillNODepositDeduct_IDLen不是数字！\\n";
            //}
            //if (this.txtBillNOType_BankGet.Text == "")
            //{
            //    strErr += "BillNOType_BankGet不能为空！\\n";
            //}
            //if (this.txtBillNOBankGet_Pre.Text == "")
            //{
            //    strErr += "BillNOBankGet_Pre不能为空！\\n";
            //}
            //if (this.txtBillNOBankGet_Mid.Text == "")
            //{
            //    strErr += "BillNOBankGet_Mid不能为空！\\n";
            //}
            //if (!PageValidate.IsNumber(txtBillNOBankGet_IDLen.Text))
            //{
            //    strErr += "BillNOBankGet_IDLen不是数字！\\n";
            //}
            //if (this.txtBillPrint_Option.Text == "")
            //{
            //    strErr += "BillPrint_Option不能为空！\\n";
            //}
            //if (this.txtCarryYear.Text == "")
            //{
            //    strErr += "CarryYear不能为空！\\n";
            //}
            //if (this.txtCarryMonth.Text == "")
            //{
            //    strErr += "CarryMonth不能为空！\\n";
            //}
            //if (this.txtAppGLCNO.Text == "")
            //{
            //    strErr += "AppGLCNO不能为空！\\n";
            //}
            //if (this.txtAppCorpNO.Text == "")
            //{
            //    strErr += "AppCorpNO不能为空！\\n";
            //}
            //if (this.txtAppUpdateState.Text == "")
            //{
            //    strErr += "AppUpdateState不能为空！\\n";
            //}
            //if (!PageValidate.IsNumber(txtAppOrder.Text))
            //{
            //    strErr += "AppOrder不是数字！\\n";
            //}

            //if (strErr != "")
            //{
            //    MessageBox.Show(this, strErr);
            //    return;
            //}
            string GetFeeDate_Type = this.DDLBGetFeeDate_Type.SelectedValue;
            int GetFeeDate_NMonths = int.Parse(this.txtGetFeeDate_NMonths.Text);
            int GetFeeDate_Day = int.Parse(this.txtGetFeeDate_Day.Text);
            string CopyMeterDate_Type = this.DDLBCopyMeterDate_Type.SelectedValue;
            int CopyMeterDate_NMonths = int.Parse(this.txtCopyMeterDate_NMonths.Text);
            int CopyMeterDate_Day = int.Parse(this.txtCopyMeterDate_Day.Text);
            string CarryForward_Type = this.DDLBCarryForward_Type.SelectedValue;
            //MessageBox.Show(this,CarryForward_Type);
            int CarryForward_NMonths = int.Parse(this.txtCarryForward_NMonths.Text);
            int CarryForward_Day = int.Parse(this.txtCarryForward_Day.Text);
            string LateFeeDaysSet_Type = this.DDLBLateFeeDaysSet_Type.SelectedValue;
            DateTime LateFeeDaysSet_Date = DateTime.Parse(this.txtLateFeeDaysSet_Date.Text);
            string LateFeeDerate_Type = this.DDLBLateFeeDerate_Type.SelectedValue;
            int LateFeeDerate_NMonths = int.Parse(this.txtLateFeeDerate_NMonths.Text);
            int LateFeeDerate_Day = int.Parse(this.txtLateFeeDerate_Day.Text);
            string LateFeeDerate_IsGetOver =this.CHBLateFeeDerate_IsGetOver.Checked?"Y":"N";
            decimal LateFeeSingleRate = decimal.Parse(this.txtLateFeeSingleRate.Text);
            string LateFeeIsUseInOutRate = this.CBXLateFeeIsUseInOutRate.Checked?"N":"Y";
            decimal LateFeeDerateInRate = decimal.Parse(this.txtLateFeeDerateInRate.Text);
            decimal LateFeeDerateOutRate = decimal.Parse(this.txtLateFeeDerateOutRate.Text);
            string NotifyBillMemo = this.txtNotifyBillMemo.Text;
            string UrgeBillMemo = this.txtUrgeBillMemo.Text;
            string BillNOType_FeeGet = this.txtBillNOType_FeeGet.Text;
            string BillNOFeeGet_Pre = this.txtBillNOFeeGet_Pre.Text;
            string BillNOFeeGet_Mid = this.txtBillNOFeeGet_Mid.Text;
            int BillNOFeeGet_IDLen = int.Parse(this.txtBillNOFeeGet_IDLen.Text);
            string BillNOType_FeeDerate = this.txtBillNOType_FeeDerate.Text;
            string BillNOFeeDerate_Pre = this.txtBillNOFeeDerate_Pre.Text;
            string BillNOFeeDerate_Mid = this.txtBillNOFeeDerate_Mid.Text;
            int BillNOFeeDerate_IDLen = int.Parse(this.txtBillNOFeeDerate_IDLen.Text);
            string BillNOType_PreGet = this.txtBillNOType_PreGet.Text;
            string BillNOPreGet_Pre = this.txtBillNOPreGet_Pre.Text;
            string BillNOPreGet_Mid = this.txtBillNOPreGet_Mid.Text;
            int BillNOPreGet_IDLen = int.Parse(this.txtBillNOPreGet_IDLen.Text);
            string BillNOType_PreBack = this.txtBillNOType_PreBack.Text;
            string BillNOPreBack_Pre = this.txtBillNOPreBack_Pre.Text;
            string BillNOPreBack_Mid = this.txtBillNOPreBack_Mid.Text;
            int BillNOPreBack_IDLen = int.Parse(this.txtBillNOPreBack_IDLen.Text);
            string BillNOType_PreTakeOut = this.txtBillNOType_PreTakeOut.Text;
            string BillNOPreTakeOut_Pre = this.txtBillNOPreTakeOut_Pre.Text;
            string BillNOPreTakeOut_Mid = this.txtBillNOPreTakeOut_Mid.Text;
            int BillNOPreTakeOut_IDLen = int.Parse(this.txtBillNOPreTakeOut_IDLen.Text);
            string BillNOType_DepositGet = this.txtBillNOType_DepositGet.Text;
            string BillNODepositGet_Pre = this.txtBillNODepositGet_Pre.Text;
            string BillNODepositGet_Mid = this.txtBillNODepositGet_Mid.Text;
            int BillNODepositGet_IDLen = int.Parse(this.txtBillNODepositGet_IDLen.Text);
            string BillNOType_DepositBack = this.txtBillNOType_DepositBack.Text;
            string BillNODepositBack_Pre = this.txtBillNODepositBack_Pre.Text;
            string BillNODepositBack_Mid = this.txtBillNODepositBack_Mid.Text;
            int BillNODepositBack_IDLen = int.Parse(this.txtBillNODepositBack_IDLen.Text);
            string BillNOType_DepositDeduct = this.txtBillNOType_DepositDeduct.Text;
            string BillNODepositDeduct_Pre = this.txtBillNODepositDeduct_Pre.Text;
            string BillNODepositDeduct_Mid = this.txtBillNODepositDeduct_Mid.Text;
            int BillNODepositDeduct_IDLen = int.Parse(this.txtBillNODepositDeduct_IDLen.Text);
            string BillNOType_BankGet = this.txtBillNOType_BankGet.Text;
            string BillNOBankGet_Pre = this.txtBillNOBankGet_Pre.Text;
            string BillNOBankGet_Mid = this.txtBillNOBankGet_Mid.Text;
            int BillNOBankGet_IDLen = int.Parse(this.txtBillNOBankGet_IDLen.Text);
            string BillPrint_Option = this.DDLBBillPrint_Option.SelectedValue;
            string CarryYear = this.DDLBCarryYear.SelectedValue;
            string CarryMonth = this.DDLBCarryMonth.SelectedValue;
            //string AppGLCNO = this.txtAppGLCNO.Text;
            //string AppCorpNO = this.txtAppCorpNO.Text;
            //string AppUpdateState = this.txtAppUpdateState.Text;
            //int AppOrder = int.Parse(this.txtAppOrder.Text);


            FeeMgrCom.Model.FeeOfGLCParaSet model = new FeeMgrCom.Model.FeeOfGLCParaSet();
            model.GetFeeDate_Type = GetFeeDate_Type;
            model.GetFeeDate_NMonths = GetFeeDate_NMonths;
            model.GetFeeDate_Day = GetFeeDate_Day;
            model.CopyMeterDate_Type = CopyMeterDate_Type;
            model.CopyMeterDate_NMonths = CopyMeterDate_NMonths;
            model.CopyMeterDate_Day = CopyMeterDate_Day;
            model.CarryForward_Type = CarryForward_Type;
            model.CarryForward_NMonths = CarryForward_NMonths;
            model.CarryForward_Day = CarryForward_Day;
            model.LateFeeDaysSet_Type = LateFeeDaysSet_Type;
            model.LateFeeDaysSet_Date = LateFeeDaysSet_Date;
            model.LateFeeDerate_Type = LateFeeDerate_Type;
            model.LateFeeDerate_NMonths = LateFeeDerate_NMonths;
            model.LateFeeDerate_Day = LateFeeDerate_Day;
            model.LateFeeDerate_IsGetOver = LateFeeDerate_IsGetOver;
            model.LateFeeSingleRate = LateFeeSingleRate;
            model.LateFeeIsUseInOutRate = LateFeeIsUseInOutRate;
            model.LateFeeDerateInRate = LateFeeDerateInRate;
            model.LateFeeDerateOutRate = LateFeeDerateOutRate;
            model.NotifyBillMemo = NotifyBillMemo;
            model.UrgeBillMemo = UrgeBillMemo;
            model.BillNOType_FeeGet = BillNOType_FeeGet;
            model.BillNOFeeGet_Pre = BillNOFeeGet_Pre;
            model.BillNOFeeGet_Mid = BillNOFeeGet_Mid;
            model.BillNOFeeGet_IDLen = BillNOFeeGet_IDLen;
            model.BillNOType_FeeDerate = BillNOType_FeeDerate;
            model.BillNOFeeDerate_Pre = BillNOFeeDerate_Pre;
            model.BillNOFeeDerate_Mid = BillNOFeeDerate_Mid;
            model.BillNOFeeDerate_IDLen = BillNOFeeDerate_IDLen;
            model.BillNOType_PreGet = BillNOType_PreGet;
            model.BillNOPreGet_Pre = BillNOPreGet_Pre;
            model.BillNOPreGet_Mid = BillNOPreGet_Mid;
            model.BillNOPreGet_IDLen = BillNOPreGet_IDLen;
            model.BillNOType_PreBack = BillNOType_PreBack;
            model.BillNOPreBack_Pre = BillNOPreBack_Pre;
            model.BillNOPreBack_Mid = BillNOPreBack_Mid;
            model.BillNOPreBack_IDLen = BillNOPreBack_IDLen;
            model.BillNOType_PreTakeOut = BillNOType_PreTakeOut;
            model.BillNOPreTakeOut_Pre = BillNOPreTakeOut_Pre;
            model.BillNOPreTakeOut_Mid = BillNOPreTakeOut_Mid;
            model.BillNOPreTakeOut_IDLen = BillNOPreTakeOut_IDLen;
            model.BillNOType_DepositGet = BillNOType_DepositGet;
            model.BillNODepositGet_Pre = BillNODepositGet_Pre;
            model.BillNODepositGet_Mid = BillNODepositGet_Mid;
            model.BillNODepositGet_IDLen = BillNODepositGet_IDLen;
            model.BillNOType_DepositBack = BillNOType_DepositBack;
            model.BillNODepositBack_Pre = BillNODepositBack_Pre;
            model.BillNODepositBack_Mid = BillNODepositBack_Mid;
            model.BillNODepositBack_IDLen = BillNODepositBack_IDLen;
            model.BillNOType_DepositDeduct = BillNOType_DepositDeduct;
            model.BillNODepositDeduct_Pre = BillNODepositDeduct_Pre;
            model.BillNODepositDeduct_Mid = BillNODepositDeduct_Mid;
            model.BillNODepositDeduct_IDLen = BillNODepositDeduct_IDLen;
            model.BillNOType_BankGet = BillNOType_BankGet;
            model.BillNOBankGet_Pre = BillNOBankGet_Pre;
            model.BillNOBankGet_Mid = BillNOBankGet_Mid;
            model.BillNOBankGet_IDLen = BillNOBankGet_IDLen;
            model.BillPrint_Option = BillPrint_Option;
            model.CarryYear = CarryYear;
            model.CarryMonth = CarryMonth;
            model.GLCParaSetID = 1;
            //model.AppGLCNO = AppGLCNO;
            //model.AppCorpNO = AppCorpNO;
            //model.AppUpdateState = AppUpdateState;
            //model.AppOrder = AppOrder;

            FeeMgrCom.BLL.FeeOfGLCParaSet bll = new FeeMgrCom.BLL.FeeOfGLCParaSet();
            bll.Update(model);

        }

        protected void txtUrgeBillMemo_TextChanged(object sender, EventArgs e)
        {

        }

        protected void DDLBCarryForward_Type_SelectedIndexChanged(object sender, EventArgs e)
        {
            DDLBCarryForward_Type_Related();
        }

        protected void DDLBCarryForward_Type_Related()
        {
            switch (DDLBCarryForward_Type.SelectedValue)
            {
                case "当月月底结转":
                    {
                        txtCarryForward_NMonths.Visible = false;
                        txtCarryForward_Day.Visible = false;
                        Label_txtCarryForward_NMonths_after.Visible = false;
                        Label_txtCarryForward_Day_after.Visible = false;
                        break;
                    }
                case "下月月底结转":
                    {
                        txtCarryForward_NMonths.Visible = false;
                        txtCarryForward_Day.Visible = false;
                        Label_txtCarryForward_NMonths_after.Visible = false;
                        Label_txtCarryForward_Day_after.Visible = false;
                        break;
                    }
                case "当月指定日期结转":
                    {
                        txtCarryForward_NMonths.Visible = false;
                        txtCarryForward_Day.Visible = true;
                        Label_txtCarryForward_NMonths_after.Text = "当月";
                        Label_txtCarryForward_Day_after.Text="日结转";
                        Label_txtCarryForward_NMonths_after.Visible = true;
                        Label_txtCarryForward_Day_after.Visible = true;
                        break;
                    }
                case "下月指定日期结转":
                    {
                        txtCarryForward_NMonths.Visible = false;
                        txtCarryForward_Day.Visible = true;
                        Label_txtCarryForward_NMonths_after.Text = "下月";
                        Label_txtCarryForward_Day_after.Text = "日结转";
                        Label_txtCarryForward_NMonths_after.Visible = true;
                        Label_txtCarryForward_Day_after.Visible = true;
                        break;
                    }
                case "N个月后月底结转":
                    {
                        txtCarryForward_NMonths.Visible = true;
                        txtCarryForward_Day.Visible = false;
                        Label_txtCarryForward_NMonths_after.Text = "个月后月底结转";
                        Label_txtCarryForward_NMonths_after.Visible = true;
                        Label_txtCarryForward_Day_after.Visible = false;
                        break;
                    }
                case "N个月后指定日期结转":
                    {
                        txtCarryForward_NMonths.Visible = true;
                        txtCarryForward_Day.Visible = true;
                        Label_txtCarryForward_NMonths_after.Text = "个月后";
                        Label_txtCarryForward_Day_after.Text = "日结转";
                        Label_txtCarryForward_NMonths_after.Visible = true;
                        Label_txtCarryForward_Day_after.Visible = true;
                        break;
                    }
            }
        }

        protected void DDLBGetFeeDate_Type_SelectedIndexChanged(object sender, EventArgs e)
        {
            DDLBGetFeeDate_Type_Related();
        }
        protected void DDLBGetFeeDate_Type_Related()
        {
            switch (DDLBGetFeeDate_Type.SelectedValue)
            {
                case "当月月底前交费":
                    {
                        txtGetFeeDate_Day.Visible = false;
                        txtGetFeeDate_NMonths.Visible = false;
                        //Label_txtGetFeeDate_NMonths_after.Text = "当月月底前交费";
                        Label_txtGetFeeDate_NMonths_after.Visible = false;
                        Label_txtGetFeeDate_Day_after.Visible = false;
                        break;
                    }
                case "当月指定日期前交费":
                    {
                        txtGetFeeDate_Day.Visible = true;
                        txtGetFeeDate_NMonths.Visible = false;
                        Label_txtGetFeeDate_NMonths_after.Text = "当月";
                        Label_txtGetFeeDate_NMonths_after.Visible = true;
                        Label_txtGetFeeDate_Day_after.Text = "日前交费";
                        Label_txtGetFeeDate_Day_after.Visible = true;
                        break;
                    }
                case "下月月底前交费":
                    {
                        txtGetFeeDate_Day.Visible = false;
                        txtGetFeeDate_NMonths.Visible = false;
//                        Label_txtGetFeeDate_NMonths_after.Text = "下月月底前交费";
                        Label_txtGetFeeDate_NMonths_after.Visible = false;
                        Label_txtGetFeeDate_Day_after.Visible = false;
                        break;
                    }
                case "下月指定日期前交费":
                    {
                        txtGetFeeDate_Day.Visible = true;
                        txtGetFeeDate_NMonths.Visible = false;
                        Label_txtGetFeeDate_NMonths_after.Text = "在下个月";
                        Label_txtGetFeeDate_NMonths_after.Visible = true;
                        Label_txtGetFeeDate_Day_after.Text = "日前交费";
                        Label_txtGetFeeDate_Day_after.Visible = true;
                        break;
                    }
                case "在指定月数内交费":
                    {
                        txtGetFeeDate_Day.Visible = false;
                        txtGetFeeDate_NMonths.Visible = true;
                        Label_txtGetFeeDate_NMonths_after.Text = "个月内交费";
                        Label_txtGetFeeDate_NMonths_after.Visible = true;
                        Label_txtGetFeeDate_Day_after.Visible = false;
                        break;
                    }
                case "在指定月数后日期前交费":
                    {
                        txtGetFeeDate_Day.Visible = true;
                        txtGetFeeDate_NMonths.Visible = true;
                        Label_txtGetFeeDate_NMonths_after.Text = "个月后";
                        Label_txtGetFeeDate_NMonths_after.Visible = true;
                        Label_txtGetFeeDate_Day_after.Text = "日前交费";
                        Label_txtGetFeeDate_Day_after.Visible = true;
                        break;
                    }
            }
        }

        protected void DDLBCopyMeterDate_Type_SelectedIndexChanged(object sender, EventArgs e)
        {
            DDLBCopyMeterDate_Type_Related();
        }

        protected void DDLBCopyMeterDate_Type_Related()
        {
            switch (DDLBCopyMeterDate_Type.SelectedValue)
            {
                case "当月指定日期抄表":
                    {
                        txtCopyMeterDate_NMonths.Visible = false;
                        Label_txtCopyMeterDate_NMonths_after.Text = "当月";
                        Label_txtCopyMeterDate_Day_after.Text = "日前抄表";
                        Label_txtCopyMeterDate_NMonths_after.Visible = true;
                        break;
                    }
                case "上月指定日期抄表":
                    {
                        txtCopyMeterDate_NMonths.Visible = false;
                        Label_txtCopyMeterDate_NMonths_after.Text = "上月";
                        Label_txtCopyMeterDate_Day_after.Text = "日前抄表";
                        Label_txtCopyMeterDate_NMonths_after.Visible = true;
                        break;
                    }
                case "指定月数前日期抄表":
                    {
                        txtCopyMeterDate_NMonths.Visible = true;
                        Label_txtCopyMeterDate_NMonths_after.Text = "个月前";
                        Label_txtCopyMeterDate_Day_after.Text = "日抄表";
                        Label_txtCopyMeterDate_NMonths_after.Visible = true;
                        break;
                    }
            }
        }

        protected void DDLBLateFeeDaysSet_Type_SelectedIndexChanged(object sender, EventArgs e)
        {
            DDLBLateFeeDaysSet_Type_Related();
        }

        protected void DDLBLateFeeDaysSet_Type_Related()
        {
            switch (DDLBLateFeeDaysSet_Type.SelectedValue)
            {
                case "按到指定截止日期计算":
                    {
                        txtLateFeeDaysSet_Date.Width = 65;
                        txtLateFeeDaysSet_Date.Visible = true;
                        Label_DDLBLateFeeDaysSet_Type_after.Text = "通知单打印后滞纳金按照锁定日期和应收日期之间计算";
                        Label_DDLBLateFeeDaysSet_Type_after.Visible = true;
                        break;
                    }
                case "不锁定":
                    {
                        txtLateFeeDaysSet_Date.Width = 0;
                        txtLateFeeDaysSet_Date.Visible = false;
                        Label_DDLBLateFeeDaysSet_Type_after.Text = "通知单打印后滞纳金按照实际收取日期和应收日期之间计算";
                        Label_DDLBLateFeeDaysSet_Type_after.Visible = true;
                        break;
                    }
            }

        }

        protected void DDLBLateFeeDerate_Type_SelectedIndexChanged(object sender, EventArgs e)
        {
            DDLBLateFeeDerate_Type_Related();
        }

        protected void DDLBLateFeeDerate_Type_Related()
        {
            switch(DDLBLateFeeDerate_Type.SelectedValue)
            {
                case "不减免":
                    {
                        Label_txtLateFeeDerate_NMonths_before.Visible = false;
                        Label_txtLateFeeDerate_Day_before.Visible = false;
                        txtLateFeeDerate_Day.Visible = false;
                        txtLateFeeDerate_NMonths.Visible = false;
                        CHBLateFeeDerate_IsGetOver.Checked= false;
                        CBXLateFeeIsUseInOutRate.Checked = true;
                        CHBLateFeeDerate_IsGetOver.Enabled = false;
                        CBXLateFeeIsUseInOutRate.Enabled = false;
                        CBXLateFeeIsUseInOutRate_Related();
                        CHBLateFeeDerate_IsGetOver_Related(); 
                        break;
                    }
                case "减免指定月数":
                    {
                        Label_txtLateFeeDerate_NMonths_before.Text = "减免";
                        Label_txtLateFeeDerate_NMonths_before.Visible = true;
                        Label_txtLateFeeDerate_Day_before.Text = "个月";
                        Label_txtLateFeeDerate_Day_before.Visible = true;
                        txtLateFeeDerate_Day.Visible = false;
                        txtLateFeeDerate_NMonths.Visible = true;
                        CHBLateFeeDerate_IsGetOver.Enabled = true;
                        CBXLateFeeIsUseInOutRate.Enabled = true;
                        CBXLateFeeIsUseInOutRate_Related();
                        CHBLateFeeDerate_IsGetOver_Related();
                        break;
                    }
                case "减免指定天数":
                    {
                        Label_txtLateFeeDerate_NMonths_before.Text = "减免";
                        Label_txtLateFeeDerate_NMonths_before.Visible = true;
                        Label_txtLateFeeDerate_Day_before.Text = "天数";
                        Label_txtLateFeeDerate_Day_before.Visible = true;
                        txtLateFeeDerate_Day.Visible = true;
                        txtLateFeeDerate_NMonths.Visible = false;
                        CHBLateFeeDerate_IsGetOver.Enabled = true;
                        CBXLateFeeIsUseInOutRate.Enabled = true;
                        CBXLateFeeIsUseInOutRate_Related();
                        CHBLateFeeDerate_IsGetOver_Related();
                        break;
                    }
                case "减免到N月后指定日期":
                    {
                        Label_txtLateFeeDerate_NMonths_before.Text = "减免到";
                        Label_txtLateFeeDerate_NMonths_before.Visible = true;
                        Label_txtLateFeeDerate_Day_before.Text = "个月后的日期";
                        Label_txtLateFeeDerate_Day_before.Visible = true;
                        txtLateFeeDerate_Day.Visible = true;
                        txtLateFeeDerate_NMonths.Visible = true;
                        CHBLateFeeDerate_IsGetOver.Enabled = true;
                        CBXLateFeeIsUseInOutRate.Enabled = true;
                        CBXLateFeeIsUseInOutRate_Related();
                        CHBLateFeeDerate_IsGetOver_Related();
                        break;
                    }
            }
        }

        protected void CBXLateFeeIsUseInOutRate_CheckedChanged(object sender, EventArgs e)
        {
            CBXLateFeeIsUseInOutRate_Related();
        }

        protected void CBXLateFeeIsUseInOutRate_Related()
        {
            txtLateFeeSingleRate.Enabled = CBXLateFeeIsUseInOutRate.Checked;
            //txtLateFeeSingleRate_MaskedEditExtender.Enabled = CBXLateFeeIsUseInOutRate.Checked;
            txtLateFeeDerateInRate.Enabled = !CBXLateFeeIsUseInOutRate.Checked;
            //txtLateFeeDerateInRate_MaskedEditExtender.Enabled = !CBXLateFeeIsUseInOutRate.Checked;
            txtLateFeeDerateOutRate.Enabled = !CBXLateFeeIsUseInOutRate.Checked;
            //txtLateFeeDerateOutRate_MaskedEditExtender.Enabled = !CBXLateFeeIsUseInOutRate.Checked;
        }

        protected void CHBLateFeeDerate_IsGetOver_CheckedChanged(object sender, EventArgs e)
        {
            CHBLateFeeDerate_IsGetOver_Related();
        }

        protected void CHBLateFeeDerate_IsGetOver_Related()
        {
            CBXLateFeeIsUseInOutRate.Enabled = CHBLateFeeDerate_IsGetOver.Checked;
            if (!CHBLateFeeDerate_IsGetOver.Checked)
            {
                CBXLateFeeIsUseInOutRate.Checked = true;
                CBXLateFeeIsUseInOutRate_Related();
            }
        }
    }
}
